#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
@Project ：turbo 
@File    ：urlpatterns.py
@Author  ：赵加响
@Date    ：2023/4/11 14:24 
@Desc    ：
"""
from django.contrib import admin
from django.urls import path, include
from rest_framework.documentation import include_docs_urls

from apps.accounts.urls import account_urlpatterns, system_settings_urlpatterns
from apps.accounts.views import APITokenObtainPairView, APIUserLoginTokenObtainPairView, UserLogoutView
from apps.common.urls import common_urlpatterns
from apps.lookups.calendars.urls import calendars_urlpatterns
from apps.rbac.urls import rbac_urlpatterns
from apps.samples.urls import samples_urlpatterns

conf_urlpatterns = [
    path('admin/', admin.site.urls),
    path('api-auth/', include('rest_framework.urls')),
    path('docs/', include_docs_urls(title="drf docs")),
]

# 用户认证 URL
jwt_urlpatterns = [
    path('login/', APITokenObtainPairView.as_view(), name='login'),
    path('api_user_login/', APIUserLoginTokenObtainPairView.as_view(), name='api login'),
    path('logout/', UserLogoutView.as_view(), name='logout'),
]

api_urlpatterns = [
    path('', include(jwt_urlpatterns)),
    path('common/', include(common_urlpatterns)),
    path('rbac/', include(rbac_urlpatterns)),
    path('account/', include(account_urlpatterns)),
    path('system_settings/', include(system_settings_urlpatterns)),
    path('calendars/', include(calendars_urlpatterns)),
    path('samples/', include(samples_urlpatterns)),
]
